import Link from "next/link"
import { getAllNotes } from "@/lib/redis"
import SidebarNoteList from "@/components/SidebarNoteList.jsx"

export default async function Sidebar() {
  const notes = await getAllNotes()
  console.log(notes);

  return (
    <>
      <section className="col sidebar">
        <Link href={'/'} className="link--unstyled">
          <section className="sidebar-header">
            <img
              className="logo"
              src="/logo.svg"
              alt="" />
            <strong>React Notes</strong>
          </section>
        </Link>
        <section className="sidebar-menu">
          {/* search */}
        </section>
        <nav>
          <SidebarNoteList notes={notes} />
        </nav>
      </section>
    </>
  )
}